package com.gitee.deeround.jdbchelper.core.impl;

import com.gitee.deeround.jdbchelper.core.DbActionFunc;
import com.gitee.deeround.jdbchelper.core.Dialect;
import com.gitee.deeround.jdbchelper.core.DialectHelper;
import org.springframework.jdbc.core.JdbcTemplate;

public class DbActionFuncImpl extends BaseDbAction implements DbActionFunc {

    private final JdbcTemplate jdbcTemplate;

    public DbActionFuncImpl(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    @Override
    public String funDate() {
        Dialect dialect = DialectHelper.getDialect(jdbcTemplate);
        return dialect.funDate();
    }

    @Override
    public String funTimestamp() {
        Dialect dialect = DialectHelper.getDialect(jdbcTemplate);
        return dialect.funTimestamp();
    }

    @Override
    public String funGuid() {
        Dialect dialect = DialectHelper.getDialect(jdbcTemplate);
        return dialect.funGuid();
    }

    @Override
    public String funWmConcat(String columnName) {
        Dialect dialect = DialectHelper.getDialect(jdbcTemplate);
        return dialect.funWmConcat(columnName);
    }
}
